package com.aloha.springframework.context.event;

import com.aloha.springframework.context.ApplicationEvent;
import com.aloha.springframework.context.ApplicationListener;

/**
 * @author DaiZhiHeng
 * @description 事件多播器
 * @date 2023/7/3 22:43
 */
public interface ApplicationEventMulticaster {

    /**
     * 添加事件监听器
     */
    void addApplicationListener(ApplicationListener<? extends ApplicationEvent> listener);

    /**
     * 移除事件监听器
     */
    void removeApplicationListener(ApplicationListener<? extends ApplicationEvent> listener);

    /**
     * 广播事件给对应的监听器
     */
    void multicastEvent(ApplicationEvent event);

}
